import Vue from 'vue'
import Vuex from 'vuex'
import menus from "./modules/menus"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    typeSelectOptions: [
      {label: '造船', value: '1'},
      {label: '修船', value: '2'},
      {label: '配套', value: '3'},
      {label: '海工', value: '4'},
    ],
    typeIdSelectOptions: [
      {
        "value": 45,
        "label": "新接订单量",
        "type": "1",
      },
      {
        "value": 46,
        "label": "完工交付量",
        "type": "1",
      },
      {
        "value": 47,
        "label": "手持订单量",
        "type": "1",
      },
      {
        "value": 48,
        "label": "修船产值",
        "type": "2",
      },
      {
        "value": 49,
        "label": "修船艘数",
        "type": "2",
      },
      {
        "value": 50,
        "label": "修船收入",
        "type": "2",
      },
      {
        "value": 51,
        "label": "配套产值",
        "type": "3",
      },
      {
        "value": 52,
        "label": "配套收入",
        "type": "3",
      },
      {
        "value": 53,
        "label": "新接订单量",
        "type": "4",
      },
      {
        "value": 54,
        "label": "完工交付量",
        "type": "4",
      },
      {
        "value": 55,
        "label": "手持订单量",
        "type": "4",
      }
    ],
    nameIdSelectOptions: [
      {
        "value": 241,
        "label": "DWT",
        "type": "1",
      },
      {
        "value": 242,
        "label": "CGT",
        "type": "1",
      },
      {
        "value": 243,
        "label": "数量",
        "type": "1",
      },
      {
        "value": 244,
        "label": "金额",
        "type": "4",
      },
      {
        "value": 245,
        "label": "数量",
        "type": "4",
      }
    ],
  },
  mutations: {
    SET_TOKEN: (state, token) => {
      state.token = token
      localStorage.setItem("token", token)
    }
  },
  modules: {
    menus
  }
})
